import React, { Component } from 'react'

export default class Child extends Component {
  render() {
    return (
      <div>
        <h2>子组件</h2>
        <div>{this.props.pmsg}</div>
        <div>{this.props.list}</div>
        <button onClick={()=>{
            //this.props.pmsg="子组件更改父组件中传递进来的pmsg数据"
            this.props.list.push('王五')
            console.log(this.props.list);
            this.forceUpdate()
        }}>更改props的数据</button>
      </div>
    )
  }
}
